package com.qyhl.webtv.commonlib.item.fuquan;

import android.view.View;
import android.widget.TextView;

import com.qyhl.webtv.basiclib.utils.StringUtils;
import com.qyhl.webtv.commonlib.R;
import com.qyhl.webtv.commonlib.entity.news.GlobalNewsBean;
import com.zhy.adapter.recyclerview.base.ItemViewDelegate;
import com.zhy.adapter.recyclerview.base.ViewHolder;

public class ItemFuQuanScoop implements ItemViewDelegate<GlobalNewsBean> {
    @Override
    public int getItemViewLayoutId() {
        return R.layout.item_fuquan_scoop;
    }

    @Override
    public boolean isForViewType(GlobalNewsBean item, int position) {
        return "18".equals(item.getType());
    }

    @Override
    public void convert(ViewHolder holder, GlobalNewsBean bean, int position) {
        holder.setText(R.id.title, bean.getTitle());

        TextView content = holder.getView(R.id.content);
        if (StringUtils.isNotEmpty(bean.getCatalogId())) {
            content.setVisibility(View.VISIBLE);
            content.setText(bean.getCatalogId());
        } else {
            content.setVisibility(View.GONE);
        }
    }
}
